package com.cndw.kungfu.comm;

import com.cndw.kungfu.config.Constants;
import com.cndw.kungfu.domain.Player;
import com.cndw.kungfu.domain.Scene;
import com.cndw.kungfu.model.Context;

public class TeamInspection {

	/**
	 * 当前是否可进行队伍操作
	 * 
	 * @param player
	 * @return
	 */
	public static boolean checkControl(Player player) {
		Scene scene = Context.getSceneServer().getSceneById(player.getSceneId());

		if (scene == null || scene.isCityUndercity() || scene.isCityUnionWar()) {
			return false;
		} else if (player.stateContains(Constants.playerState256_dart)) {
			return false;
		} else if (player.stateContains(Constants.playerState512_battleAuto)) {
			return false;
		} else if (player.stateContains(Constants.playerState1024_aiUndercity)) {
			return false;
		}
		return true;
	}

}
